<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
	<title>酒店tttt资料</title>
	<meta name="description" content="Kenny is a Dashboard & Admin Site Responsive Template by hencework." />
	<meta name="keywords" content="admin, admin dashboard, admin template, cms, crm, Kenny Admin, kennyadmin, premium admin templates, responsive admin, sass, panel, software, ui, visualization, web app, application" />
	<meta name="author" content="hencework" />

	<!-- Favicon -->
	<link rel="shortcut icon" href="favicon.ico">
	<link rel="icon" href="favicon.ico" type="image/x-icon">

	<!-- Data table CSS --> 
	<link href="__STATIC__/admin/dist/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />

	<!-- Custom CSS -->
	<link href="__STATIC__/admin/dist/css/style.css" rel="stylesheet" type="text/css">

	<!-- select -->
	<link href="__STATIC__/admin/dist/css/second.css" rel="stylesheet" type="text/css">
	<!-- search -->
	<link href="__STATIC__/admin/dist/search/css/base.css" rel="stylesheet" type="text/css">
	<link href="__STATIC__/admin/dist/search/css/index.css" rel="stylesheet" type="text/css">
	<link href="__STATIC__/admin/dist/search/css/search-part.css" rel="stylesheet" type="text/css">

	<!--up更改-->
	<link rel="stylesheet" href="__STATIC__/admin/dist/css/modify-up.css" type="text/css"/>
 
	<link href="__STATIC__/admin/dist/css/app.css" rel="stylesheet" type="text/css">
	<style>
		#searchHotel{
			padding: 3px 20px;
			background-color: #566FC9;
			color: #fff;
			border: 1px solid #566FC9;		
			margin-top: 10px;
		}
		.panel-heading .search-content{
			float: left !important;
		}
	</style>
</head>
<body>
	<div class="wrapper"> 
		<!-- Main Content -->
		<div class="page-wrapper page-continer" style="padding-top: 60px !important;">
			<div class="container-fluid">
				<!-- Row -->
				<div class="row">
					<div class="col-sm-12">
						<div class="panel panel-default card-view">
							<div class="panel_childern" id="lenght_panel">
								<div class="panel-heading">
									<div class="pull-left pis">
										<div class="search-content">
											<script>
												var searchType = 'hotel,area'; 
											</script>
											<div class="col-sm-6 col-xs-12 sjj">
												<div class="form-group">
													<label class="control-label col-sm-3 lables">目的地： </label>
													<div class="col-sm-9">
														{include file='admin@common/search'/}
													</div>
													</div>
												</div>
											<div class="col-sm-3 col-xs-12 sjj">
												<div class="form-group">
													<label class="control-label col-sm-3 lables">酒店ID： </label>
													<div class="col-sm-9">
														<input type="text" value="{$hotel_id}" id="hotel_id" style="height: 48px;width: 100%;line-height: 48px;padding: 0 36px 0 12px;border: 1px solid #ccc !important;border-radius: 4px;"/>
													</div>
												</div>
											</div>
												<button type="button" id="searchHotel" class="btn btn-success mr-10" onclick="search()">查询</button>
												<div class="interlacing-box"></div>
												<div class="col-sm-6 col-xs-12 sjj" id="keyword2" <?php if((empty($cktype) || ($cktype!='area' && $cktype != 'site')) && empty($hid) ){?> style="display:none;"<?php }?>>
													<div class="form-group">
														<label class="control-label col-sm-3 lables">关键字： </label>
														<div class="col-sm-9">
															{include file='admin@common/searchKey'/}
														</div>
													</div>
												</div>
											</div>

										<div class="search-btn"><i class="fa fa-angle-double-up icon-01"></i><i class="fa fa-angle-double-down icon-02"></i></div>
									</div>
									<div class="clearfix"></div>
								</div>
								<div class="Editors">
									<div class="dataTables_length" id="edit_datable_2_length" style="margin-bottom:0;">
										<span>
											<a href="{:url('admin/hoteldata/hotelShow')}">  
												<input type="button" name="btnAdd" data-toggle="modal" data-target="#editor-modal" value="新增" id="btnAdd"
												 class="SrvButton"></a>
										</span>
										<span>
											<a href="javascript:;">  
												<input type="button" name="btnAdd" data-toggle="modal" data-target="#editor-modal" value="删除" id="btnDel" class="SrvButton" onclick="deleteAll()"></a>
										</span>
										<span>
											<a href="javascript:;">  
												<input type="button" name="btnAdd" data-toggle="modal" data-target="#editor-modal" value="清空筛选条件" id="btnReset"
												 class="SrvButton"></a>
										</span>
										<span><input type="button" class="SrvButton" value="刷新" onclick="window.location = window.location.href"></span>
										<input type="button" id="modal_sz" class="SrvButton" value="设置" onclick="">
										<?php if(session('user')['roleid'] == '1'){ ?>
											<span><a href="/admin/cache/cacheAll?type=hotel" target="_blank"><input type="button" class="SrvButton" value="重新生成缓存"></a></span>
										<?php } ?>
										<span><input type="checkbox" name="" value="" id="Deletes" class="SrvButton" onclick="ShowHide(this)" <?php if(isset($ishidden) && $ishidden==0){echo "checked";} ?>>显示隐藏</span>
										<label>显示
											<select name="edit_datable_2_length" aria-controls="edit_datable_2" class="change_limit" id="count">
												<option value="10" <?php if($limit==10){echo "selected";} ?>>10</option>
												<option value="20" <?php if($limit==20){echo "selected";} ?>>20</option>
												<option value="30" <?php if($limit==30){echo "selected";} ?>>30</option>
												<option value="40" <?php if($limit==40){echo "selected";} ?>>40</option>
												<option value="50" <?php if($limit==50){echo "selected";} ?>>50</option>
											</select> 项结果
										</label>
										<div class="page">{$page}</div>
									</div>
								</div>
								
								<div id="divContent" class="divContent">
									<div id="divEmpty" class="divNotDataInfo gray_12_normal">
										<label>暂无相关记录显示</label>
										<div class="pt">
												<div class="mb-10">
											<a href="Hotel-infor.html">
												<input class="mt-0" type="button" name="btnAdd" data-toggle="modal" data-target="#editor-modal" value="返回上一级" id="btnAdd"
												 class="SrvButton" style="padding: 3px 20px;
													background-color: #566FC9;
													color: #fff;
													border: 1px solid #566FC9;
													outline: none;"></a>
											</div> 
											<div>
											<a id="nexttrag" href="#">
												<input  class="mt-0" type="button" name="btnAdd" data-toggle="modal" data-target="#editor-modal" value="返回下一级" id="btnAdd"
												 class="SrvButton" style="padding: 3px 20px;
												 background-color: #566FC9;
												 color: #fff; 
												 border: 1px solid #566FC9;
												 outline: none;"></a>
												 </div>
										</div>
									</div>
								</div>
								<div class="panel-wrapper collapse in" >
									<div class="panel-body">
										<div class="table-wrap mt40">
											<div class="table-responsive">
												<div class="hidden_moduel disnonde">
													<form>  
														<input type="hidden" class="url" value="{$url}">
														<div class="move_td">
															<ul id="foo" class="block__list block__list_tags" onclick="sorTable()">
																<?php if(empty($order)){ ?>
																	<li class="order" name="hh" hideCol="1" onclick="hideCol(this)">行號</li>
																	<li class="order" name="fxgl" hideCol="1" onclick="hideCol(this)">房型管理</li>
																	<li class="order" name="jqgl" hideCol="1" onclick="hideCol(this)">價錢管理</li>
																	<!-- <li class="order" name="zhgl" hideCol="1" onclick="hideCol(this)">帳號管理</li> -->
																	<li class="order" name="jd" hideCol="1" onclick="hideCol(this)">酒店</li>
																	<li class="order" name="jd_e" hideCol="1" onclick="hideCol(this)">酒店(ENG)</li>
																	<li class="order" name="dq" hideCol="1" onclick="hideCol(this)">地區</li>
																	<!-- <li class="order" name="hold" hideCol="1" onclick="hideCol(this)">Hold</li> -->
																	<li class="order" name="b2c" hideCol="1" onclick="hideCol(this)">B2C备注</li>
																	<li class="order" name="ts_c" hideCol="1" onclick="hideCol(this)">推送Ctrip</li>
																	<li class="order" name="ts_e" hideCol="1" onclick="hideCol(this)">推送Elong</li>
																	<li class="order" name="ts_tb" hideCol="1" onclick="hideCol(this)">推送淘宝</li>
																	<li class="order" name="dj" hideCol="1" onclick="hideCol(this)">等级</li>
																	<li class="order" name="dh" hideCol="1" onclick="hideCol(this)">電話</li>
																	<li class="order" name="cz" hideCol="1" onclick="hideCol(this)">傳真</li>
																	<li class="order" name="dz" hideCol="1" onclick="hideCol(this)">地址</li>
																	<li class="order" name="rm" hideCol="1" onclick="hideCol(this)">热门</li>
																	<li class="order" name="zt" hideCol="1" onclick="hideCol(this)">狀態</li>
																	<li class="order" name="tjsj" hideCol="1" onclick="hideCol(this)">添加時間</li>
																<?php }else{
																    foreach($order as $k=>$v){
																?>
																	<li class="order" name="{$k}" hideCol="{$v[1]}" onclick="hideCol(this)" {if condition="empty($v[1])"}style="background-color: rgb(204, 204, 204);" draggable="false"{/if}>{$v[0]}</li>
																<?php } }?>
															</ul>
														</div> 
														<div class="move_btn">
															<input class="btn btn-danger" type="button" value="取消" onClick="window.location.reload()">
															<input class="btn btn-success" type="submit" value="保存" onclick="submitBtnClick()">
														</div>
													</form>
												</div>


												<div id="table_wappers" class="dataTables_wrapper no-footer">
													<table id="datable_1" class="table table-hover display" style="width: 3000px;">
														<thead>
															<tr>
																<th name="checkme"><input type="checkbox"></th>
																<th name="xg" style="width:50px;">修改</th>
																<th name="sc" style="width:50px;">删除</th>
																<?php if(empty($order)){ ?>
																	<th name="hh">行號</th>
																	<th name="fxgl">房型管理</i></th>
																	<th name="jqgl">價錢管理</th>
																	<!-- <th name="zhgl">帳號管理</th> -->
																	<th name="jd" order="<?php echo ($orders[0]=='name_hk') ? $orders[1] : "" ?>" data-name="name_hk" class="th_order sorting_<?php echo ($orders[0]=='name_hk') ? $orders[1] : "" ?>">酒店</th>
																	<th name="jd_e" order="<?php echo ($orders[0]=='name_en') ? $orders[1] : "" ?>" data-name="name_en" class="th_order sorting_<?php echo ($orders[0]=='name_en') ? $orders[1] : "" ?>">酒店(ENG)</th>
																	<th name="dq">地區</th>
																	<th name="b2c">B2C备注</th>
																	<th name="ts_c">推送Ctrip</th>
																	<th name="ts_e">推送Elong</th>
																	<th name="ts_tb">推送淘宝</th>
																	<th name="dj" order="<?php echo ($orders[0]=='rankid') ? $orders[1] : "" ?>" data-name="rankid" class="th_order sorting_<?php echo ($orders[0]=='rankid') ? $orders[1] : "" ?>">等级</th>
																	<th name="dh">電話</th>
																	<th name="cz">傳真</th>
																	<th name="dz" style="width: 400px;">地址</th>
																	<th name="rm" order="<?php echo ($orders[0]=='is_hot') ? $orders[1] : "" ?>" data-name="is_hot" class="th_order sorting_<?php echo ($orders[0]=='is_hot') ? $orders[1] : "" ?>">热门</th>
																	<th name="zt" order="<?php echo ($orders[0]=='state') ? $orders[1] : "" ?>" data-name="state" class="th_order sorting_<?php echo ($orders[0]=='state') ? $orders[1] : "" ?>">狀態</th>
																	<th name="tjsj" order="<?php echo ($orders[0]=='addtime') ? $orders[1] : "" ?>" data-name="addtime" class="th_order sorting_<?php echo ($orders[0]=='addtime') ? $orders[1] : "" ?>">添加時間</th>						
																<?php }else{ ?>
																	<?php foreach ($order as $key => $value) {?>
																		<?php 
																			if(isset($translate[$key]) && ($translate[$key]=='name_hk' || $translate[$key]=='name_en' || $translate[$key]=='is_hot' || $translate[$key]=='state' || $translate[$key]=='addtime' || $translate[$key]=='rankid')){
																				$class = "th_order";
																				$data_name = $translate[$key];
																			}else{
																				$class = "";
																				$data_name = "";
																			}
																		 ?>
																			<th name="{$key}" order="<?php echo ($orders[0]==$data_name) ? $orders[1] : "" ?>" class="{$class} sorting_<?php echo ($orders[0]==$data_name) ? $orders[1] : "" ?>" data-name="{$data_name}" data="{$value[1]=='0' ? 'hide' :'';}";>{$value[0]}</th>
																	<?php } ?>
																<?php } ?>
															</tr>
														</thead>   
														<tbody class="list">
														<?php if(!empty($hotelLists)){ ?>
														<?php foreach ($hotelLists as $key => $value) {?>
															<tr>
																<td><input type="checkbox" name="ids[]" value="<?php echo $value['id'] ?>"></td>
																<td name="xg" style="width:50px;">
																	<a href="{:url('admin/hoteldata/hotelShow','id='.$value['id'])}" class="text-inverse  p-r-10" title="" data-toggle="tooltip"
																	 data-original-title="Edit"><i class="fa fa-pencil"></i></a>
																</td>
																<td name="sc" style="width:50px;">
																	<a href="{:url('admin/hoteldata/hotelDelete','id='.$value['id'])}" class="text-inverse" title="" data-toggle="tooltip" data-original-title="Delete"><i class="fa fa-trash"></i></a>
																</td>
																<?php if(empty($order)){ ?>
																	<td name="hh"><?php echo $key+1 ?></td>
																	<td name="fxgl"><a href="{:url('admin/hotel/hotelRoomList','des_id='.$value['id'])}" target="_blank">房型管理</a></td>
																	<td name="jqgl"><a href="{:url('admin/hoteldata/pricePage','hotelid='.$value['id'])}" target="_blank">價錢管理</a></td>
															<!-- 		<td name="zhgl" style="width:300px;"> 
																		<a href="#" class="red">帳號管理</a>
																		<br>
																		<a href="#" class="green">酒店设定</a>
																	</td>  -->
																	<td name="jd"><a href="{:url('admin/hoteldata/hotelShow','id='.$value['id'])}"><?php echo $value['name_hk'] ?></a></td>
																	<td name="jd_e"><a href="{:url('admin/hoteldata/hotelShow','id='.$value['id'])}"><?php echo $value['name_en'] ?></a></td>
																	<td name="dq"><?php echo $value['area'] ?></td>
																	<td name="b2c"><a href="{:url('admin/hoteldata/b2cRemarks','id='.$value['id'])}" target="_blank">B2C备注</a></td>
																	<td name="ts_c"><a href="">推送Ctrip</a></td>
																	<td name="ts_e"><a href="">推送elong</a></td>
																	<td name="ts_tb"><a href="">推送淘宝</a></td>
																	<td name="dj"><?php echo $value['rankid']?></td>
																	<td name="dh"><?php echo $value['phone'] ?></td>
																	<td name="cz"><?php echo $value['fax'] ?></td>
																	<td name="dz"><?php echo $value['dz'] ?></td>
																	<td name="rm"><?php echo ($value['is_hot']==1) ? "N" : "Y" ?></td>
																	<td name="zt"><?php echo ($value['state']==0) ? "关房" : "正常" ?></td>
																	<td name="tjsj"><?php echo date('Y-m-d',$value['addtime']); ?></td>
																<?php }else{ ?>
																	<?php foreach ($order as $k => $v){ ?>
																		<?php switch ($k) {
																			case 'hh':
																				$html = $key+1;
																				break;
																			case 'fxgl':
																				$html = '<a href="'.url("admin/hotel/hotelRoomList","des_id=".$value["id"]).'" target="_blank">房型管理</a>';
																				break;
																			case 'jqgl':
																				$html = '<a href="'.url('admin/hoteldata/pricePage','hotelid='.$value['id']).'" target="_blank">價錢管理</a>';
																				break;
																			// case 'zhgl':
																			// 	$html = '<a href="'.$value['id'].'" class="red">帳號管理</a><br><a href="'.$value['id'].'" class="green">酒店设定</a>';
																			// 	break;
																			case 'b2c':
																				$html = '<a target="_blank" href="'.url('admin/hoteldata/b2cRemarks','id='.$value['id']).'">B2C备注</a>';
																				break;
																			case 'ts_c':
																				$html = '<a href="'.$value['id'].'">推送Ctrip</a>';
																				break;
																			case 'ts_e':
																				$html = '<a href="'.$value['id'].'">推送elong</a>';
																				break;
																			case 'ts_tb':
																				$html = '<a href="'.$value['id'].'">推送淘宝</a>';
																				break;
																			case 'rm':
																				$html = ($value['is_hot']==1) ? "N" : "Y";
																				break;
																			case 'zt':
																				$html = ($value['state']==0) ? "关房" : "正常";
																				break;
																			case 'tjsj':
																				$html = date('Y-m-d',$value['addtime']);
																				break;
																			case 'jd':
																				$html = '<a href="'.url('admin/hoteldata/hotelShow','id='.$value['id']).'">'.$value[$translate[$k]].'</a>';
																				break;
																			case 'jd_e':
																				$html = '<a href="'.url('admin/hoteldata/hotelShow','id='.$value['id']).'">'.$value[$translate[$k]].'</a>';
																				break;

																			default:
																				$html = $value[$translate[$k]];
																				break;

																		}?>
																		<td name='<?php echo $k?>' {if condition="empty($v[1])"}style="display:none;"{/if}  data="{$v[1]=='0' ? 'hide' :'';}";><?php echo $html; ?></td>
																	<?php }?>
																<?php } ?>
															</tr>
														<?php }}else{ ?>
															<tr><td colspan="20" id="no-area" style="color:red;border-bottom: none;">暂无相关的记录显示</td></tr>
														<?php } ?>
														</tbody>
													</table>
												</div>
											</div>
										</div>
									</div>
								</div>
							</div>

						</div>
					</div>
				</div>
				<!-- /Row -->

			</div>

		</div> 
		<!-- /Main Content -->

	</div>

	<!-- /#wrapper -->

	<!-- JavaScript -->

	<!-- jQuery -->
	<script src="__STATIC__/admin/dist/js/jquery.min.js"></script>

	<!-- Bootstrap Core JavaScript -->
	<script src="__STATIC__/admin/dist/js/bootstrap.min.js"></script>
	<script src="__STATIC__/admin/dist/js/dataTab.js"></script>
	<!-- Data table JavaScript -->
	<script src="__STATIC__/admin/dist/datatables/media/js/jquery.dataTables.min.js"></script>
	<script src="__STATIC__/admin/dist/js/dataTables-data.js"></script>
	<!-- Slimscroll JavaScript -->
	<script src="__STATIC__/admin/dist/js/jquery.slimscroll.js"></script>

	<!-- Fancy Dropdown JS -->
	<script src="__STATIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>

	<!-- Init JavaScript -->
	<script src="__STATIC__/admin/dist/js/init.js"></script>

	<!-- distpicker -->
	<script src="__STATIC__/admin/dist/js/distpicker.data.js"></script>
	<script src="__STATIC__/admin/dist/js/distpicker.js"></script>
	<script src="__STATIC__/admin/dist/js/main.js"></script>

	<!-- Autocompleter -->
	<script src="__STATIC__/admin/dist/js/jquery.autocompleter.js"></script>
	<script src="__STATIC__/admin/dist/js/autodata.js"></script>

	<!-- select -->
	<script src="__STATIC__/admin/dist/js/second.js"></script>
	<!-- search -->
	<script src="__STATIC__/admin/dist/search/js/moment.min.js"></script>
	<script src="__STATIC__/admin/dist/search/js/jquery.daterangepicker.js"></script>
	<script src="__STATIC__/admin/dist/search/js/jquery.SuperSlide.2.1.1.js"></script>
	<script src="__STATIC__/admin/dist/search/js/base.js"></script>
	<script src="__STATIC__/admin/dist/search/js/index.js"></script>
	<script src="__STATIC__/admin/dist/search/js/dialog.js"></script>
	<script src="__STATIC__/common/js/search.js"></script>

	<!-- sort JavaScript -->
	<script src="__STATIC__/admin/dist/js/angular.min.js"></script>
	<script src="__STATIC__/admin/dist/js/Sortable.js"></script>
	<script src="__STATIC__/admin/dist/js/ng-sortable.js"></script>
	<script src="__STATIC__/admin/dist/js/data-table.js"></script>
	<script src="__STATIC__/admin/dist/js/Hotel.js"></script>
	

	<script>
		$('.change_limit').change(function(){
			var limit = $(this).val();
			$.ajax({
				url:'{:url("admin/hoteldata/searchData")}',
				type:'post',
				data:'limit='+limit,
				dataType:'json',
				success:function(res){
					if(res==1){
						window.location.reload();
						return false;
					}
				}
			});
		});

		function ShowHide(checkbox){
			if(checkbox.checked==true){
				AjaxSettingDisplay('hide');
			}else{
				AjaxSettingDisplay('show');
			}			
		}

		// ajax改变筛选是否显示隐藏的条件
		// type [show|hide]
		function AjaxSettingDisplay(type){
			var ishidden = 1;
			if(type=='hide'){
				ishidden = 0;
			}
			$.ajax({
				url:"{:url('admin/hoteldata/searchData')}",
				data:'ishidden='+ishidden,
				type:'post',
				success:function(res){
					if(res==1){
						window.location.reload();
						return false;
					}					
				}
			});
		}

		$('#btnReset').click(function(){
			$.ajax({
				url:"{:url('admin/hoteldata/searchData')}",
				data:'type=clear',
				type:'post',
				success:function(res){
					if(res==1){
						window.location.reload();
						return false;
					}					
				}
			});			
		});

    function search(){
    	var did = $('#des_id').val()
    	var hid = $('#des_id1').val()
    	var area = $('#des').val()
    	var hotel = $('#keyword').val()
    	var cktype = $('#des').attr('cktype')
		var hotel_id = $('#hotel_id').val()
        // if(did==0){
        //     alert('请选择酒店');
        //     return false;
        // }
        if(cktype=='area'){
        	data = '&searchType=latelySearch';
        }else if(cktype=='hotel'){
        	data = "&searchType=latelyBrowse";
        }else{
        	data = '';
		}
			$.ajax({
				url:"{:url('admin/hoteldata/searchData')}",
				data:'id='+did+'&area='+area+'&hid='+hid+'&hotel='+hotel+'&cktype='+cktype+data+'&hotel_id='+hotel_id,
				type:'post',
				success:function(res){
					if(res==1){
						window.location.href="{:url('admin/Hoteldata/hotelList')}";
						return false;
					}					
				}
			});            	
    }

    $('.th_order').click(function(){
    	var attr = $(this).attr('order');
    	var field = $(this).attr('data-name');
    	if(attr=='' || attr=='asc'){
    		var order = 'desc';
    	}else if(attr=='desc'){
    		var order = 'asc';
    	}

    	$.ajax({
    		url:"{:url('admin/hoteldata/searchData')}",
    		data:'orderby='+field+" "+order,
    		type:'post',
    		success:function(res){
				if(res==1){
					window.location.reload();
					return false;
				}
    		}

    	});

    });

	//批量删除
	function deleteAll(){
	 	var ids = $("input[name='ids[]']:checked").serialize();

		$.ajax({
			url : "/admin/hoteldata/deleteAll",
			data : ids,
			type : "POST",
			dataType:'json',			
			success : function(data) {
				var data = JSON.parse(data);
				if(data.code == 1){
					window.location.href='{:url("admin/hoteldata/hotelList")}';
				}
				
			}

		})
		
	}    
	</script>
	
</body>

</html>